﻿from Position import *
from NPC import *
import copy

class Player(NPC):
    """Instancia um jogador no jogo. 
    Jogadores sao controlaveis, atacando, sendo atacados e se movimentando."""

    def __init__(self, nameP = "NULL", levelP = 1, 
                 hpP = 1, hpMaxP = 1, mpP = 1, mpMaxP = 1, 
                 atkBaseP = 1, defBaseP = 1, dodgeBaseP = 0.0, 
                 filecharP = None, moveSpeedP = 1.0,
                 isAttackingP = False, attackDelayP = 1.0, attackWaitP = 0.0,
                 xP = 0, yP = 0 , orientation = "down",
                 xpP = 0, moneyP = 0, 
                 rHandEqpP = False, lHandEqpP = False, armorEqpP = False, accesorieEqpP = False,
                 rHandItemP = None, lHandItemP = None, armorItemP = None, accesorieItemP = None,
                 attackP = 1, defenseP = 1, dodgeP = 0.0,
                 inventorioP = [] ):
        '''Instancia um Jogador no jogo.'''
        self._name = nameP
        self._level = levelP
        self._hp = hpP
        self._hpMax = hpMaxP
        self._mp = mpP
        self._mpMax = mpMaxP
        self._atkBase = atkBaseP
        self._defBase = defBaseP
        self._dodgeBase = dodgeBaseP
        self._filechar = filecharP
        self._moveSpeed = moveSpeedP
        self._isAttacking = isAttackingP
        self._attackWait = attackWaitP
        self._attackDelay = attackDelayP
        self._x = xP
        self._y = yP
        self._orientation = orientation
        #New to player
        self._xp = xpP
        self._money = moneyP
        self._rHandEqp = rHandEqpP
        self._lHandEqp = lHandEqpP
        self._armorEqp = armorEqpP
        self._accesorieEqp = accesorieEqpP
        self._rHandItem = rHandItemP
        self._lHandItem = lHandItemP
        self._armorItem = armorItemP
        self._accesoryItem = accesorieItemP
        self._attack = attackP
        self._defense = defenseP
        self._dodge = dodgeP
        self._inventorio = copy.deepcopy(inventorioP)
    
    def getXp(self):
        '''==> x.xp'''
        return self._xp
    def setXp(self, xpP):
        '''x.xp = xpP'''
        self._xp = xpP

    def getMoney(self):
        '''==> x.money'''
        return self._money
    def setMoney(self, moneyP):
        '''x.money = moneyP'''
        self._money = moneyP

    def getRHandEqp(self):
        '''==> x.rHandEqp'''
        return self._rHandEqp
    def setRHandEqp(self, rHandEqpP):
        '''x.rHandEqp = rHandEqpP'''
        self._rHandEqp = rHandEqpP

    def getLHandEqp(self):
        '''==> x.lHandEqp'''
        return self._lHandEqp
    def setLHandEqp(self, lHandEqpP):
        '''x.lHandEqp = lHandEqpP'''
        self._lHandEqp = lHandEqpP

    def getArmorEqp(self):
        '''==> x.armorEqp'''
        return self._armorEqp
    def setArmorEqp(self, armorEqpP):
        '''x.armorEqp = armorEqpP'''
        self._armorEqp = armorEqpP

    def getAccesorieEqp(self):
        '''==> x.accesorieEqp'''
        return self._accesorieEqp
    def setAccesorieEqp(self, accesorieEqpP):
        '''x.accesorieEqp = accesorieEqp'''
        self._accesorieEqp = accesorieEqpP

    def getRHandItem(self):
        '''==> x.rHandItem'''
        return self._rHandItem
    def setRHandItem(self, rHandItemP):
        '''x.rHandItem = rHandItemP'''
        self._rHandItem = rHandItemP

    def getLHandItem(self):
        '''==> x.lHandItem'''
        return self._lHandItem
    def setLHandItem(self, lHandItemP):
        '''x.lHandItem = lHandItemP'''
        self._lHandItem = lHandItemP

    def getArmorItem(self):
        '''==> x.armorItem'''
        return self._armorItem
    def setArmorItem(self, armorItemP):
        '''x.armorItem = armorItemP'''
        self._armorItem = armorItemP

    def getAccesorieItem(self):
        '''==> x.accesorieItem'''
        return self._accesorieItem
    def setAccesorieItem(self, accesorieItemP):
        '''x.accesorieItem = accesorieItem'''
        self._accesorieItem = accesorieItemP

    def getAttack(self):
        '''==> x.attack'''
        return self._attack
    def setAttack(self, attackP):
        '''x.attack = attackP'''
        self._attack = attackP

    def getDefense(self):
        '''==> x.defense'''
        return self._defense
    def setDefense(self, defenseP):
        '''x.defense = defenseP'''
        self._defense = defenseP

    def getDodge(self):
        '''==> x.dodge'''
        return self._dodge
    def setDodge(self, dodgeP):
        '''x.dodge = dodgeP'''
        self._dodge = dodgeP

    def getInventorio(self):
        '''==> x.inventorio'''
        return self._inventorio
    def setInventorio(self, inventorioP):
        '''x.inventorio = inventorioP'''
        self._inventorio = copy.deepcopy(inventorioP)


